from selenium.webdriver.common.by import By
from utils.log_utils import logger
from page_object.base_page import BasePage


class HomePage(BasePage):
    # 注意：双下换线是对象的属性
    __MENU_CONTACTS = (By.ID, "menu_contacts")

    def link_to_contacts(self):
        logger.info("正在转向通讯录页面")
        self.do_find(self.__MENU_CONTACTS).click()

        from page_object.contacts_page import ContactsPage
        return ContactsPage(self.driver)
